#pragma once

#include "common.h"


class TestGenCode : public ProtobufTest
{
public:
	virtual void Test();

private:
	void TestCostTime();
};

template<typename T>
void TestTimeConsume(int count)
{
	T msg;
	msg.set_id(123);
	msg.set_name("boxer");
	msg.add_scores(100);

	std::string bin;
	T obj;
	time_t begin = clock();
	for (size_t i = 0; i < count; i++)
	{
		msg.SerializeToString(&bin);
		obj.ParseFromString(bin);
	}
	time_t end = clock();

	std::cout << msg.GetTypeName() << " use time " << double(end - begin) / CLOCKS_PER_SEC << std::endl;
}
